package com.mh.zookeeper.zkclient;

import org.I0Itec.zkclient.ZkClient;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;

import static com.mh.zookeeper.PropertiesUtils.getZookeeperConnectStr;

/**
 * @author MH
 * @since 2021-12-21
 */
public class DeleteNode {


    private static ZooKeeper zooKeeper;

    public static void main(String[] args) throws IOException, InterruptedException {

        ZkClient zkClient = new ZkClient(getZookeeperConnectStr());
        System.out.println("会话被创建了..");

        // 递归删除节点
        String path = "/lg-zkclient/c1";
        zkClient.createPersistent(path + "/c11");
        zkClient.deleteRecursive(path);
        System.out.println("递归删除成功");

    }

}
